<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="root">
        <one></one>
        <two>
            <h5 slot="c">345</h5>
        </two>
    </div>
    <template id="one1">
        <div>
            <p>1--{{hh}}</p>
        </div>
    </template>
    <template id="two1">
        <div>
            <p>2</p>
            <slot name="c"></slot>
        </div>
    </template>
    <script src="./vue.js"></script>
    <script>
        //阻止vue在启动时生成生产提示
        Vue.config.productionTip = false;
        const min1={
            data(){
                return{
                    hh:'乐高'
                }
            }
        }
        const one = {
            template: '#one1',
mixins:[min1]
        }
        const two = {
            template: '#two1',

        }
        //创建vue实例
        new Vue({
            el: '.root',
            data: function () {
                return {
                    name: '',
                }
            },
            components: {
                one, two,
            }
        })
    </script>
</body>

</html>